# +----------------------------------------------------------------------
# | Pink [ A modern python web framework ]
# +----------------------------------------------------------------------
# | Copyright (c) 2023 http:#unnnnn.com All rights reserved.
# +----------------------------------------------------------------------
# | Author: chenjianhua <unnnnn@foxmail.com>
# +----------------------------------------------------------------------

from ..facades import Gate


class AuthorizesRequest:
    """Request mixin to add permission handling to requests."""

    def authorize(self, permission: str, *args):
        """Check if the user performing the current request has the given permission."""
        return Gate.authorize(permission, *args)
